#include "choselevescene.h"
#include<QPainter>
#include<QMenuBar>
#include<mypushbutton.h>
#include<QDebug>
#include<QTimer>

choselevescene::choselevescene(QWidget *parent) : QMainWindow(parent)
{
    //配置
    this->setFixedSize(400,688);
    //设置图标
    setWindowIcon(QIcon(":/2tb.jpg"));
    setWindowTitle("choosing");
    //开始退出
    QMenuBar*bar=menuBar();
    setMenuBar(bar);
    QMenu*startmenu=bar->addMenu("开始");
    QAction*quitaction=startmenu->addAction("退出");
    connect(quitaction,&QAction::triggered,[=](){
        this->close();
    });
    //返回按钮
    mypushbutton* backbtn=new mypushbutton(":/back.jfif");
    backbtn->setParent(this);
    backbtn->setFixedSize(40,40);
    backbtn->move(this->width()-backbtn->width(),this->height()-backbtn->height());
    connect(backbtn,&mypushbutton::clicked,[=](){
        qDebug()<<"back";
        emit this->choosesenceback();
    });

}
 void choselevescene::paintEvent(QPaintEvent*){
     QPainter painter(this);
     QPixmap pix;
     pix.load(":/bj2.jpg");
     painter.drawPixmap(0,0,this->width(),this->height(),pix);
     pix.load(":/bt.png");
     painter.drawPixmap(-10,0,pix);

 }
